package fiuba.webapp.action;

import fiuba.model.Configuracion;
import fiuba.model.Seccion;
import fiuba.service.GenericManager;

public class IndexAction extends BaseAction  {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3217457921547661978L;
	private GenericManager<Configuracion, Long> configuracionManager;
	private String seccionIdRedirect = "";
	public String getSeccionIdRedirect() {
		return seccionIdRedirect;
	}
	public void setSeccionIdRedirect(String seccionIdRedirect) {
		this.seccionIdRedirect = seccionIdRedirect;
	}
	public void setConfiguracionManager(
			GenericManager<Configuracion, Long> configuracionManager) {
		this.configuracionManager = configuracionManager;
	}
	
	
	public String list() {
		try {
			Seccion s = this.configuracionManager.get(1L).getSeccionInicial();
			this.seccionIdRedirect = s.getId().toString();
		}
		catch (Exception e) {
			return "offline";
		}
		return SUCCESS;
	}

}
